package com.coolweather.app.util;

import android.R.bool;
import android.content.Context;
import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;

/**
 *	鏈被鐢ㄤ簬淇濆瓨鎴栬�鑾峰彇鏁版嵁鏃朵娇鐢� */
public class SharePreferenceUtil {
	public static final String SP_NAME = "config";
	private static SharedPreferences sp;
	
	public static void saveBoolean(Context context, String key, boolean value)
	{
		if (sp == null) {
			sp = context.getSharedPreferences(SP_NAME, Context.MODE_PRIVATE);
		}
		Editor editor =  sp.edit();
		editor.putBoolean(key, value);
		editor.commit();
	}
	
	public static void getBoolean(Context context, String key)
	{
		if (sp == null) {
			sp = context.getSharedPreferences(SP_NAME, Context.MODE_PRIVATE);
		}
		sp.getBoolean(key, false);
	}
}









